Skip to content

Stdlib: withhold ext/gmp on reference profile (#22860)#23000

Closed
PurHur wants to merge 1 commit into
masterfrom
agent/stdlib-22860-gmp-phantom
Closed

Stdlib: withhold ext/gmp on reference profile (#22860)#23000
PurHur wants to merge 1 commit into
masterfrom
agent/stdlib-22860-gmp-phantom

Conversation

@PurHur

@PurHur PurHur commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Withhold ext/gmp on the reference profile so extension_loaded('gmp'), function_exists('gmp_*'), and class_exists('GMP') match Zend when host ext-gmp is absent (CompilerVersion::supportsGmp() / GmpExtensionPolicy, same phantom gate as snmp/zip).
  • Enable the existing pure-PHP GMP surface under PHP_COMPILER_PROFILE=8.4.
  • php-src: ext/gmp/gmp.c; PHP: ext/gmp/GmpExtensionPolicy.php + Module/ModuleRegistry/BuiltinIntrospectionPolicy.

Closes #22860

Test plan

  • php bin/vm.php test/repro/extension_loaded_gmp_phantom.phploaded=no / gmp_add=no / class=no
  • PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/extension_loaded_gmp_phantom.php → yes + sum=5
  • Zend host php test/repro/extension_loaded_gmp_phantom.php → no (matches reference VM)
  • ./script/phpunit.sh --filter 'extension_loaded_gmp|GmpModuleTest|add_cmp|gmp_binomial|…' → OK (27 tests)
  • php script/bootstrap-inventory.php --check → OK 6519/6519
  • AOT bin/compile.php smoke blocked this run by stuck PackJitHelper helper emit on the harness (shared Module gates; retry when helper cache is healthy)

Trust probe (this run)

Gate Status
bootstrap-inventory ok 6519/6519
release-readiness user_release_ready: nonorth-star5-fast fail (gen-0 mismatch #8713/#22642)
bootstrap-selfhost-link partial (stale gen-0 → Zend fallback)

Made with Cursor

Match Zend without ext-gmp: extension_loaded('gmp') / function_exists('gmp_*') /
class_exists('GMP') stay false until PHP_COMPILER_PROFILE=8.4 enables the
pure-PHP surface (same phantom gate as snmp/zip).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur

PurHur commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

Closing as duplicate of #22998 (already on master: 33ab5d394 Stdlib: withhold gmp on reference profile without host php-gmp (#22860)).

This branch reached the same gate independently; master won the merge race.

@PurHur PurHur closed this Jul 25, 2026
@PurHur
PurHur deleted the agent/stdlib-22860-gmp-phantom branch July 25, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: extension_loaded('gmp') + gmp_* callable on default profile — Zend false (ext/gmp)

1 participant